package com.zz.schoolwall.service.impl;

import com.zz.schoolwall.dao.SchoolWallCommentDao;
import com.zz.schoolwall.domain.SchoolWallCommentDO;
import com.zz.schoolwall.service.SchoolWallCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SchoolWallCommentServiceImpl implements SchoolWallCommentService {
        @Autowired
        private SchoolWallCommentDao schoolWallCommentDao;

        @Override
        public int  remove(Long commentId){
            return schoolWallCommentDao.deleteByPrimaryKey(commentId);
        }
        @Override
        public int  logicRemove(Long commentId){
            return schoolWallCommentDao.logicRemove(commentId);
        }

        @Override
        public int increaseLikeNum(Long commentId) {
            return schoolWallCommentDao.increaseLikeNum(commentId);
        }

        @Override
        public int decreaseLikeNum(Long commentId) {
            return schoolWallCommentDao.decreaseLikeNum(commentId);
        }

        @Override
        public int increaseCommentNum(Long commentId) {
            return schoolWallCommentDao.increaseCommentNum(commentId);
        }

        @Override
        public int decreaseCommentNum(Long commentId) {
            return schoolWallCommentDao.decreaseCommentNum(commentId);
        }

        @Override
        public int save(SchoolWallCommentDO record) {
            return schoolWallCommentDao.insertSelective(record);
        }

        @Override
        public SchoolWallCommentDO get(Long commentId) {
            return schoolWallCommentDao.selectByPrimaryKey(commentId);
        }
        @Override
        public List<SchoolWallCommentDO> list(Map<String,Object> map) {
        return schoolWallCommentDao.list(map);
    }
        @Override
        public int count(Map<String,Object> map) {
        return schoolWallCommentDao.count(map);
    }

        @Override
        public int update(SchoolWallCommentDO record) {
            return schoolWallCommentDao.updateByPrimaryKeySelective(record);
        }


}